package com.tedu.egmvc3.base.response;

import lombok.*;

@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor

public class StatsTest {
    private Integer state;
    private String message;
    private Object data;

    public StatsTest(StatusCodeTest statusCodeTest) {
        this.state = statusCodeTest.getState();
        this.message = statusCodeTest.getMessage();
    }
    public StatsTest(StatusCodeTest statusCodeTest ,Object data) {
        this.state = statusCodeTest.getState();
        this.message = statusCodeTest.getMessage();
        this.data=data;
    }

    public static StatsTest ok(Object data){//成功有返回数据
        return new StatsTest(StatusCodeTest.OPERATION_SUCCESS,data);
    }
    public static StatsTest ok(){//成功无返回数据
        return StatsTest.ok(null);
    }
}
